program blank;

{$mode objfpc}{$H+}

uses 
  math,SysUtils,facecat;  

var
  appPaint:FCPaint;
  tChart:FCChart;

{重绘背景的实现方法
inView:视图
paint:绘图对象
clipRect:裁剪区域}
procedure OnPaint(var inView:FCView; var paint:FCPaint; clipRect:FCRect);
begin
  OnPaintDefault(inView, paint, clipRect);
end;

{重绘边框的实现方法
inView:视图
paint:绘图对象
clipRect:裁剪区域}
procedure OnPaintBorder(var inView:FCView; var paint:FCPaint; clipRect:FCRect);
begin
  OnPaintBorderDefault(inView, paint, clipRect);
end;

{鼠标按下的方法
inView:视图
mp:坐标
buttons:按钮
clicks:点击次数
delta:滚轮值}
procedure OnMouseDown(var inView:FCView; mp:FCPoint; buttons:integer; clicks:integer; delta:integer);
var
  chart:FCChart;
begin
  if inView.viewType = 'chart' then
    begin
    chart := FCChart(inView);
		if length(chart.addingPlotChart) > 0 then
      begin
			InvalidateView(inView);
			AddPlotDefault(chart, true, mp, false, mp);
			chart.addingPlotChart := '';
      end
		else
      begin
			TouchDownChart(chart, true, mp, false, mp);
			InvalidateView(inView);
      end;
    end
  else
    OnMouseDownDefault(inView, mp, buttons, clicks, delta);
end;

{鼠标抬起的方法
inView:视图
mp:坐标
buttons:按钮
clicks:点击次数
delta:滚轮值}
procedure OnMouseUp(var inView:FCView; mp:FCPoint; buttons:integer; clicks:integer; delta:integer);
begin
  OnMouseUpDefault(inView, mp, buttons, clicks, delta);
end;

{鼠标移动的方法
inView:视图
mp:坐标
buttons:按钮
clicks:点击次数
delta:滚轮值}
procedure OnMouseMove(var inView:FCView; mp:FCPoint; buttons:integer; clicks:integer; delta:integer);
begin
  OnMouseMoveDefault(inView, mp, buttons, clicks, delta);
end;

{鼠标点击的方法
inView:视图
firstTouch:是否第一次触摸
firstPoint:第一次触摸的坐标
secondTouch:是否第二次触摸
secondPoint:第二次触摸的坐标
clicks:点击次数}
procedure OnClick(var inView:FCView; firstTouch:boolean; firstPoint:FCPoint; secondTouch:boolean; secondPoint:FCPoint; clicks:integer);
var
  tabView:FCTabView;
  paint:FCPaint;
begin
  OnClickDefault(inView, firstTouch, firstPoint, secondTouch, secondPoint, clicks);
  if inView.viewName = 'Indicator' then
    begin
		if (inView.text = 'BOLL') or (inView.text = 'MA') then
			tChart.mainIndicator := inView.text
		else
			tChart.showIndicator := inView.text;
		CalcChartIndicator(tChart);
		tabView := FCTabView(inView.GetParent().GetParent().GetParent());
		SelectTabPage(tabView, tabView.tabPages[0]);
    paint := inView.GetPaint();
		Invalidate(paint);
    end
	else if inView.viewName = 'Plot' then
    begin
		tChart.addingPlotChart := inView.text;
		tabView := FCTabView(inView.GetParent().GetParent().GetParent());
		SelectTabPage(tabView, tabView.tabPages[0]);
		paint := inView.GetPaint();
		Invalidate(paint);
    end;
end;

{视图的鼠标滚动方法
view 视图
mp 坐标
buttons 按钮 0未按下 1左键 2右键
clicks 点击次数
delta 滚轮值}
procedure OnMouseWheel(var inView:FCView; mp:FCPoint; buttons:integer; clicks:integer; delta:integer);
begin
  OnMouseWheelDefault(inView, mp, buttons, clicks, delta);
end;

{视图的键盘按下方法
view 视图
value 按键值}
procedure OnKeyDown(var inView:FCView; value:integer);
begin
  OnKeyDownDefault(inView, value);
end;

{视图的键盘抬起方法
view 视图
value 按键值}
procedure OnKeyUp(var inView:FCView; value:integer);
begin
  OnKeyUpDefault(inView, value);
end;

{更新悬浮状态
views:视图集合}
procedure UpdateView(var views:viewArray);
begin
  UpdateViewDefault(views);
end;

{Windows消息循环}
procedure WndProc(hWnd:integer; message:integer; wParam:integer; lParam:integer); cdecl;
begin
  WndProcDefault(appPaint, hWnd, message, wParam, lParam);
end;

procedure GetSecurities(var securityDatas:array of SecurityData);
var
  sData1:SecurityData;
  sData2:SecurityData;
  sData3:SecurityData;
  sData4:SecurityData;
  sData5:SecurityData;
  sData6:SecurityData;
  sData7:SecurityData;
  sData8:SecurityData;
  sData9:SecurityData;
  sData10:SecurityData;
  sData11:SecurityData;
  sData12:SecurityData;
  sData13:SecurityData;
  sData14:SecurityData;
  sData15:SecurityData;
  sData16:SecurityData;
  sData17:SecurityData;
  sData18:SecurityData;
  sData19:SecurityData;
  sData20:SecurityData;
  sData21:SecurityData;
  sData22:SecurityData;
  sData23:SecurityData;
  sData24:SecurityData;
  sData25:SecurityData;
  sData26:SecurityData;
  sData27:SecurityData;
  sData28:SecurityData;
  sData29:SecurityData;
  sData30:SecurityData;
  sData31:SecurityData;
  sData32:SecurityData;
  sData33:SecurityData;
  sData34:SecurityData;
  sData35:SecurityData;
  sData36:SecurityData;
  sData37:SecurityData;
  sData38:SecurityData;
  sData39:SecurityData;
  sData40:SecurityData;
  sData41:SecurityData;
  sData42:SecurityData;
  sData43:SecurityData;
  sData44:SecurityData;
  sData45:SecurityData;
  sData46:SecurityData;
  sData47:SecurityData;
  sData48:SecurityData;
  sData49:SecurityData;
  sData50:SecurityData;
  sData51:SecurityData;
  sData52:SecurityData;
  sData53:SecurityData;
  sData54:SecurityData;
  sData55:SecurityData;
  sData56:SecurityData;
  sData57:SecurityData;
  sData58:SecurityData;
  sData59:SecurityData;
  sData60:SecurityData;
  sData61:SecurityData;
  sData62:SecurityData;
  sData63:SecurityData;
  sData64:SecurityData;
  sData65:SecurityData;
  sData66:SecurityData;
  sData67:SecurityData;
  sData68:SecurityData;
  sData69:SecurityData;
  sData70:SecurityData;
  sData71:SecurityData;
  sData72:SecurityData;
  sData73:SecurityData;
  sData74:SecurityData;
  sData75:SecurityData;
  sData76:SecurityData;
  sData77:SecurityData;
  sData78:SecurityData;
  sData79:SecurityData;
  sData80:SecurityData;
  sData81:SecurityData;
  sData82:SecurityData;
  sData83:SecurityData;
  sData84:SecurityData;
  sData85:SecurityData;
  sData86:SecurityData;
  sData87:SecurityData;
  sData88:SecurityData;
  sData89:SecurityData;
  sData90:SecurityData;
  sData91:SecurityData;
  sData92:SecurityData;
  sData93:SecurityData;
  sData94:SecurityData;
  sData95:SecurityData;
  sData96:SecurityData;
  sData97:SecurityData;
  sData98:SecurityData;
  sData99:SecurityData;
  sData100:SecurityData;
begin
  sData1 := SecurityData.Create();
  sData1.volume := 78469.756458;
  sData1.close := 15684.25;
  sData1.high := 15965.01;
  sData1.low := 15272.69;
  sData1.open := 15297.22;
  sData1.date := 1605052800.0;
  securityDatas[0] := sData1;
  sData2 := SecurityData.Create();
  sData2.volume := 102196.366592;
  sData2.close := 16291.87;
  sData2.high := 16340.71;
  sData2.low := 15440.65;
  sData2.open := 15684.26;
  sData2.date := 1605139200.0;
  securityDatas[1] := sData2;
  sData3 := SecurityData.Create();
  sData3.volume := 75691.891014;
  sData3.close := 16320.71;
  sData3.high := 16480.01;
  sData3.low := 15952.36;
  sData3.open := 16291.86;
  sData3.date := 1605225600.0;
  securityDatas[2] := sData3;
  sData4 := SecurityData.Create();
  sData4.volume := 59116.357179;
  sData4.close := 16070.46;
  sData4.high := 16327.0;
  sData4.low := 15670.01;
  sData4.open := 16320.05;
  sData4.date := 1605312000.0;
  securityDatas[3] := sData4;
  sData5 := SecurityData.Create();
  sData5.volume := 43596.851513;
  sData5.close := 15957.01;
  sData5.high := 16180.01;
  sData5.low := 15774.73;
  sData5.open := 16069.57;
  sData5.date := 1605398400.0;
  securityDatas[4] := sData5;
  sData6 := SecurityData.Create();
  sData6.volume := 81300.685924;
  sData6.close := 16713.58;
  sData6.high := 16880.01;
  sData6.low := 15864.01;
  sData6.open := 15957.01;
  sData6.date := 1605484800.0;
  securityDatas[5] := sData6;
  sData7 := SecurityData.Create();
  sData7.volume := 115192.02613;
  sData7.close := 17659.39;
  sData7.high := 17858.83;
  sData7.low := 16538.01;
  sData7.open := 16713.09;
  sData7.date := 1605571200.0;
  securityDatas[6] := sData7;
  sData8 := SecurityData.Create();
  sData8.volume := 141984.264415;
  sData8.close := 17776.13;
  sData8.high := 18476.94;
  sData8.low := 17222.01;
  sData8.open := 17659.39;
  sData8.date := 1605657600.0;
  securityDatas[7] := sData8;
  sData9 := SecurityData.Create();
  sData9.volume := 93009.571008;
  sData9.close := 17802.83;
  sData9.high := 18179.81;
  sData9.low := 17335.66;
  sData9.open := 17777.76;
  sData9.date := 1605744000.0;
  securityDatas[8] := sData9;
  sData10 := SecurityData.Create();
  sData10.volume := 88423.028489;
  sData10.close := 18655.68;
  sData10.high := 18815.23;
  sData10.low := 17740.05;
  sData10.open := 17802.82;
  sData10.date := 1605830400.0;
  securityDatas[9] := sData10;
  sData11 := SecurityData.Create();
  sData11.volume := 71308.137138;
  sData11.close := 18703.81;
  sData11.high := 18965.91;
  sData11.low := 18308.59;
  sData11.open := 18655.67;
  sData11.date := 1605916800.0;
  securityDatas[10] := sData11;
  sData12 := SecurityData.Create();
  sData12.volume := 74492.806006;
  sData12.close := 18414.61;
  sData12.high := 18750.01;
  sData12.low := 17699.8;
  sData12.open := 18703.81;
  sData12.date := 1606003200.0;
  securityDatas[11] := sData12;
  sData13 := SecurityData.Create();
  sData13.volume := 74179.661546;
  sData13.close := 18368.01;
  sData13.high := 18766.01;
  sData13.low := 18000.01;
  sData13.open := 18413.89;
  sData13.date := 1606089600.0;
  securityDatas[12] := sData13;
  sData14 := SecurityData.Create();
  sData14.volume := 70126.693681;
  sData14.close := 19160.02;
  sData14.high := 19410.0;
  sData14.low := 18207.99;
  sData14.open := 18368.02;
  sData14.date := 1606176000.0;
  securityDatas[13] := sData14;
  sData15 := SecurityData.Create();
  sData15.volume := 70760.56353;
  sData15.close := 18719.12;
  sData15.high := 19444.01;
  sData15.low := 18570.01;
  sData15.open := 19160.01;
  sData15.date := 1606262400.0;
  securityDatas[14] := sData15;
  sData16 := SecurityData.Create();
  sData16.volume := 102420.321403;
  sData16.close := 17149.48;
  sData16.high := 18915.04;
  sData16.low := 16188.01;
  sData16.open := 18718.84;
  sData16.date := 1606348800.0;
  securityDatas[15] := sData16;
  sData17 := SecurityData.Create();
  sData17.volume := 84036.578341;
  sData17.close := 17139.53;
  sData17.high := 17457.63;
  sData17.low := 16438.09;
  sData17.open := 17149.48;
  sData17.date := 1606435200.0;
  securityDatas[16] := sData17;
  sData18 := SecurityData.Create();
  sData18.volume := 60835.734083;
  sData18.close := 17719.86;
  sData18.high := 17880.5;
  sData18.low := 16865.57;
  sData18.open := 17139.54;
  sData18.date := 1606521600.0;
  securityDatas[17] := sData18;
  sData19 := SecurityData.Create();
  sData19.volume := 55329.026303;
  sData19.close := 18185.0;
  sData19.high := 18360.06;
  sData19.low := 17517.01;
  sData19.open := 17719.85;
  sData19.date := 1606608000.0;
  securityDatas[18] := sData19;
  sData20 := SecurityData.Create();
  sData20.volume := 96227.350495;
  sData20.close := 19695.88;
  sData20.high := 19777.04;
  sData20.low := 18185.0;
  sData20.open := 18185.01;
  sData20.date := 1606694400.0;
  securityDatas[19] := sData20;
  sData21 := SecurityData.Create();
  sData21.volume := 100331.141203;
  sData21.close := 18764.97;
  sData21.high := 19888.01;
  sData21.low := 18350.0;
  sData21.open := 19695.88;
  sData21.date := 1606780800.0;
  securityDatas[20] := sData21;
  sData22 := SecurityData.Create();
  sData22.volume := 75848.875728;
  sData22.close := 19204.1;
  sData22.high := 19342.01;
  sData22.low := 18330.01;
  sData22.open := 18764.97;
  sData22.date := 1606867200.0;
  securityDatas[21] := sData22;
  sData23 := SecurityData.Create();
  sData23.volume := 64987.682732;
  sData23.close := 19421.91;
  sData23.high := 19598.01;
  sData23.low := 18867.21;
  sData23.open := 19204.09;
  sData23.date := 1606953600.0;
  securityDatas[22] := sData23;
  sData24 := SecurityData.Create();
  sData24.volume := 65481.220724;
  sData24.close := 18650.53;
  sData24.high := 19527.01;
  sData24.low := 18565.32;
  sData24.open := 19422.35;
  sData24.date := 1607040000.0;
  securityDatas[23] := sData24;
  sData25 := SecurityData.Create();
  sData25.volume := 42922.758573;
  sData25.close := 19147.67;
  sData25.high := 19177.01;
  sData25.low := 18500.01;
  sData25.open := 18650.52;
  sData25.date := 1607126400.0;
  securityDatas[24] := sData25;
  sData26 := SecurityData.Create();
  sData26.volume := 37043.101861;
  sData26.close := 19359.41;
  sData26.high := 19420.01;
  sData26.low := 18857.01;
  sData26.open := 19147.67;
  sData26.date := 1607212800.0;
  securityDatas[25] := sData26;
  sData27 := SecurityData.Create();
  sData27.volume := 40833.661907;
  sData27.close := 19166.91;
  sData27.high := 19420.92;
  sData27.low := 18902.89;
  sData27.open := 19358.68;
  sData27.date := 1607299200.0;
  securityDatas[26] := sData27;
  sData28 := SecurityData.Create();
  sData28.volume := 56080.515386;
  sData28.close := 18324.12;
  sData28.high := 19294.85;
  sData28.low := 18200.01;
  sData28.open := 19166.91;
  sData28.date := 1607385600.0;
  securityDatas[27] := sData28;
  sData29 := SecurityData.Create();
  sData29.volume := 75498.213856;
  sData29.close := 18541.29;
  sData29.high := 18639.58;
  sData29.low := 17650.01;
  sData29.open := 18324.12;
  sData29.date := 1607472000.0;
  securityDatas[28] := sData29;
  sData30 := SecurityData.Create();
  sData30.volume := 52890.685094;
  sData30.close := 18254.64;
  sData30.high := 18557.33;
  sData30.low := 17911.13;
  sData30.open := 18541.3;
  sData30.date := 1607558400.0;
  securityDatas[29] := sData30;
  sData31 := SecurityData.Create();
  sData31.volume := 72610.734259;
  sData31.close := 18036.54;
  sData31.high := 18292.74;
  sData31.low := 17572.34;
  sData31.open := 18254.82;
  sData31.date := 1607644800.0;
  securityDatas[30] := sData31;
  sData32 := SecurityData.Create();
  sData32.volume := 47592.761572;
  sData32.close := 18808.7;
  sData32.high := 18948.67;
  sData32.low := 18020.71;
  sData32.open := 18036.54;
  sData32.date := 1607731200.0;
  securityDatas[31] := sData32;
  sData33 := SecurityData.Create();
  sData33.volume := 56560.831744;
  sData33.close := 19175.0;
  sData33.high := 19411.01;
  sData33.low := 18711.13;
  sData33.open := 18808.7;
  sData33.date := 1607817600.0;
  securityDatas[32] := sData33;
  sData34 := SecurityData.Create();
  sData34.volume := 47257.211294;
  sData34.close := 19273.15;
  sData34.high := 19349.01;
  sData34.low := 19000.01;
  sData34.open := 19175.0;
  sData34.date := 1607904000.0;
  securityDatas[33] := sData34;
  sData35 := SecurityData.Create();
  sData35.volume := 61792.483421;
  sData35.close := 19426.44;
  sData35.high := 19570.01;
  sData35.low := 19050.01;
  sData35.open := 19273.7;
  sData35.date := 1607990400.0;
  securityDatas[34] := sData35;
  sData36 := SecurityData.Create();
  sData36.volume := 97061.040854;
  sData36.close := 21335.53;
  sData36.high := 21560.01;
  sData36.low := 19278.61;
  sData36.open := 19426.44;
  sData36.date := 1608076800.0;
  securityDatas[35] := sData36;
  sData37 := SecurityData.Create();
  sData37.volume := 148769.444419;
  sData37.close := 22808.99;
  sData37.high := 23699.71;
  sData37.low := 21233.01;
  sData37.open := 21335.53;
  sData37.date := 1608163200.0;
  securityDatas[36] := sData37;
  sData38 := SecurityData.Create();
  sData38.volume := 79646.144315;
  sData38.close := 23107.4;
  sData38.high := 23285.19;
  sData38.low := 22350.01;
  sData38.open := 22797.16;
  sData38.date := 1608249600.0;
  securityDatas[37] := sData38;
  sData39 := SecurityData.Create();
  sData39.volume := 82430.712232;
  sData39.close := 23821.62;
  sData39.high := 24171.48;
  sData39.low := 22750.01;
  sData39.open := 23107.4;
  sData39.date := 1608336000.0;
  securityDatas[38] := sData39;
  sData40 := SecurityData.Create();
  sData40.volume := 74797.201958;
  sData40.close := 23455.53;
  sData40.high := 24295.01;
  sData40.low := 23060.01;
  sData40.open := 23821.61;
  sData40.date := 1608422400.0;
  securityDatas[39] := sData40;
  sData41 := SecurityData.Create();
  sData41.volume := 83424.441428;
  sData41.close := 22719.72;
  sData41.high := 24102.78;
  sData41.low := 21815.01;
  sData41.open := 23455.55;
  sData41.date := 1608508800.0;
  securityDatas[40] := sData41;
  sData42 := SecurityData.Create();
  sData42.volume := 87033.13616;
  sData42.close := 23810.8;
  sData42.high := 23837.11;
  sData42.low := 22353.41;
  sData42.open := 22719.89;
  sData42.date := 1608595200.0;
  securityDatas[41] := sData42;
  sData43 := SecurityData.Create();
  sData43.volume := 112830.021287;
  sData43.close := 23232.77;
  sData43.high := 24100.01;
  sData43.low := 22810.01;
  sData43.open := 23810.8;
  sData43.date := 1608681600.0;
  securityDatas[42] := sData43;
  sData44 := SecurityData.Create();
  sData44.volume := 69013.844252;
  sData44.close := 23729.21;
  sData44.high := 23794.44;
  sData44.low := 22703.43;
  sData44.open := 23232.4;
  sData44.date := 1608768000.0;
  securityDatas[43] := sData44;
  sData45 := SecurityData.Create();
  sData45.volume := 78024.251646;
  sData45.close := 24712.48;
  sData45.high := 24789.87;
  sData45.low := 23434.74;
  sData45.open := 23729.0;
  sData45.date := 1608854400.0;
  securityDatas[44] := sData45;
  sData46 := SecurityData.Create();
  sData46.volume := 97806.523386;
  sData46.close := 26493.4;
  sData46.high := 26867.04;
  sData46.low := 24500.01;
  sData46.open := 24712.48;
  sData46.date := 1608940800.0;
  securityDatas[45] := sData46;
  sData47 := SecurityData.Create();
  sData47.volume := 145880.8092;
  sData47.close := 26281.67;
  sData47.high := 28422.01;
  sData47.low := 25700.01;
  sData47.open := 26493.41;
  sData47.date := 1609027200.0;
  securityDatas[46] := sData47;
  sData48 := SecurityData.Create();
  sData48.volume := 79408.740817;
  sData48.close := 27079.42;
  sData48.high := 27500.01;
  sData48.low := 26101.01;
  sData48.open := 26281.55;
  sData48.date := 1609113600.0;
  securityDatas[47] := sData48;
  sData49 := SecurityData.Create();
  sData49.volume := 69255.341092;
  sData49.close := 27385.01;
  sData49.high := 27410.01;
  sData49.low := 25880.01;
  sData49.open := 27079.43;
  sData49.date := 1609200000.0;
  securityDatas[48] := sData49;
  sData50 := SecurityData.Create();
  sData50.volume := 95356.067826;
  sData50.close := 28875.55;
  sData50.high := 28996.01;
  sData50.low := 27320.01;
  sData50.open := 27385.01;
  sData50.date := 1609286400.0;
  securityDatas[49] := sData50;
  sData51 := SecurityData.Create();
  sData51.volume := 75491.419522;
  sData51.close := 28923.64;
  sData51.high := 29300.01;
  sData51.low := 27850.01;
  sData51.open := 28875.56;
  sData51.date := 1609372800.0;
  securityDatas[50] := sData51;
  sData52 := SecurityData.Create();
  sData52.volume := 54134.113624;
  sData52.close := 29331.7;
  sData52.high := 29600.01;
  sData52.low := 28624.58;
  sData52.open := 28923.64;
  sData52.date := 1609459200.0;
  securityDatas[51] := sData52;
  sData53 := SecurityData.Create();
  sData53.volume := 126100.088124;
  sData53.close := 32178.34;
  sData53.high := 33300.01;
  sData53.low := 28946.54;
  sData53.open := 29331.71;
  sData53.date := 1609545600.0;
  securityDatas[52] := sData53;;
  sData54 := SecurityData.Create();
  sData54.volume := 110771.806254;
  sData54.close := 33000.06;
  sData54.high := 34778.12;
  sData54.low := 31963.0;
  sData54.open := 32176.46;
  sData54.date := 1609632000.0;
  securityDatas[53] := sData54;
  sData55 := SecurityData.Create();
  sData55.volume := 121030.155465;
  sData55.close := 31988.72;
  sData55.high := 33600.01;
  sData55.low := 28130.01;
  sData55.open := 33000.06;
  sData55.date := 1609718400.0;
  securityDatas[54] := sData55;
  sData56 := SecurityData.Create();
  sData56.volume := 111890.475678;
  sData56.close := 33949.54;
  sData56.high := 34360.01;
  sData56.low := 29900.01;
  sData56.open := 31989.76;
  sData56.date := 1609804800.0;
  securityDatas[55] := sData56;
  sData57 := SecurityData.Create();
  sData57.volume := 116093.037717;
  sData57.close := 36769.37;
  sData57.high := 36939.22;
  sData57.low := 33288.01;
  sData57.open := 33949.54;
  sData57.date := 1609891200.0;
  securityDatas[56] := sData57;
  sData58 := SecurityData.Create();
  sData58.volume := 121506.449096;
  sData58.close := 39432.29;
  sData58.high := 40365.01;
  sData58.low := 36300.01;
  sData58.open := 36769.37;
  sData58.date := 1609977600.0;
  securityDatas[57] := sData58;
  sData59 := SecurityData.Create();
  sData59.volume := 138625.042444;
  sData59.close := 40582.82;
  sData59.high := 41950.01;
  sData59.low := 36500.01;
  sData59.open := 39432.49;
  sData59.date := 1610064000.0;
  securityDatas[58] := sData59;
  sData60 := SecurityData.Create();
  sData60.volume := 75785.989675;
  sData60.close := 40088.23;
  sData60.high := 41380.01;
  sData60.low := 38720.01;
  sData60.open := 40586.97;
  sData60.date := 1610150400.0;
  securityDatas[59] := sData60;
  sData61 := SecurityData.Create();
  sData61.volume := 112638.990321;
  sData61.close := 38150.03;
  sData61.high := 41350.01;
  sData61.low := 35111.12;
  sData61.open := 40088.23;
  sData61.date := 1610236800.0;
  securityDatas[60] := sData61;
  sData62 := SecurityData.Create();
  sData62.volume := 231175.583454;
  sData62.close := 35404.48;
  sData62.high := 38264.75;
  sData62.low := 30420.01;
  sData62.open := 38150.03;
  sData62.date := 1610323200.0;
  securityDatas[61] := sData62;
  sData63 := SecurityData.Create();
  sData63.volume := 133948.161996;
  sData63.close := 34051.25;
  sData63.high := 36628.01;
  sData63.low := 32531.01;
  sData63.open := 35410.38;
  sData63.date := 1610409600.0;
  securityDatas[62] := sData63;
  sData64 := SecurityData.Create();
  sData64.volume := 124477.924938;
  sData64.close := 37371.39;
  sData64.high := 37850.01;
  sData64.low := 32380.01;
  sData64.open := 34049.16;
  sData64.date := 1610496000.0;
  securityDatas[63] := sData64;
  sData65 := SecurityData.Create();
  sData65.volume := 102950.399421;
  sData65.close := 39144.51;
  sData65.high := 40100.01;
  sData65.low := 36701.24;
  sData65.open := 37371.39;
  sData65.date := 1610582400.0;
  securityDatas[64] := sData65;
  sData66 := SecurityData.Create();
  sData66.volume := 111365.804668;
  sData66.close := 36742.23;
  sData66.high := 39747.77;
  sData66.low := 34538.89;
  sData66.open := 39145.22;
  sData66.date := 1610668800.0;
  securityDatas[65] := sData66;
  sData67 := SecurityData.Create();
  sData67.volume := 86348.441508;
  sData67.close := 35994.99;
  sData67.high := 37950.01;
  sData67.low := 35357.81;
  sData67.open := 36737.44;
  sData67.date := 1610755200.0;
  securityDatas[66] := sData67;
  sData68 := SecurityData.Create();
  sData68.volume := 80157.737384;
  sData68.close := 35828.62;
  sData68.high := 36852.51;
  sData68.low := 33850.01;
  sData68.open := 35994.99;
  sData68.date := 1610841600.0;
  securityDatas[67] := sData68;
  sData69 := SecurityData.Create();
  sData69.volume := 70693.90404;
  sData69.close := 36631.28;
  sData69.high := 37469.84;
  sData69.low := 34800.01;
  sData69.open := 35825.0;
  sData69.date := 1610928000.0;
  securityDatas[68] := sData69;
  sData70 := SecurityData.Create();
  sData70.volume := 79596.541309;
  sData70.close := 35891.5;
  sData70.high := 37850.01;
  sData70.low := 35844.07;
  sData70.open := 36622.47;
  sData70.date := 1611014400.0;
  securityDatas[69] := sData70;
  sData71 := SecurityData.Create();
  sData71.volume := 89368.432918;
  sData71.close := 35468.24;
  sData71.high := 36415.32;
  sData71.low := 33400.01;
  sData71.open := 35901.95;
  sData71.date := 1611100800.0;
  securityDatas[70] := sData71;
  sData72 := SecurityData.Create();
  sData72.volume := 134548.811336;
  sData72.close := 30850.14;
  sData72.high := 35600.01;
  sData72.low := 30071.01;
  sData72.open := 35468.24;
  sData72.date := 1611187200.0;
  securityDatas[71] := sData72;
  sData73 := SecurityData.Create();
  sData73.volume := 138345.853436;
  sData73.close := 32945.18;
  sData73.high := 33826.54;
  sData73.low := 28850.01;
  sData73.open := 30852.0;
  sData73.date := 1611273600.0;
  securityDatas[72] := sData73;
  sData74 := SecurityData.Create();
  sData74.volume := 64595.297675;
  sData74.close := 32078.01;
  sData74.high := 33456.01;
  sData74.low := 31390.17;
  sData74.open := 32950.01;
  sData74.date := 1611360000.0;
  securityDatas[73] := sData74;
  sData75 := SecurityData.Create();
  sData75.volume := 57978.047966;
  sData75.close := 32259.91;
  sData75.high := 33071.01;
  sData75.low := 30900.01;
  sData75.open := 32078.01;
  sData75.date := 1611446400.0;
  securityDatas[74] := sData75;
  sData76 := SecurityData.Create();
  sData76.volume := 88499.236921;
  sData76.close := 32254.21;
  sData76.high := 34875.01;
  sData76.low := 31910.01;
  sData76.open := 32259.46;
  sData76.date := 1611532800.0;
  securityDatas[75] := sData76;
  sData77 := SecurityData.Create();
  sData77.volume := 84866.207055;
  sData77.close := 32467.78;
  sData77.high := 32921.89;
  sData77.low := 30837.38;
  sData77.open := 32254.2;
  sData77.date := 1611619200.0;
  securityDatas[76] := sData77;
  sData78 := SecurityData.Create();
  sData78.volume := 95911.971711;
  sData78.close := 30366.16;
  sData78.high := 32557.3;
  sData78.low := 29241.73;
  sData78.open := 32464.02;
  sData78.date := 1611705600.0;
  securityDatas[77] := sData78;
  sData79 := SecurityData.Create();
  sData79.volume := 92621.155617;
  sData79.close := 33364.87;
  sData79.high := 33783.99;
  sData79.low := 29842.11;
  sData79.open := 30362.2;
  sData79.date := 1611792000.0;
  securityDatas[78] := sData79;
  sData80 := SecurityData.Create();
  sData80.volume := 193388.622446;
  sData80.close := 34252.21;
  sData80.high := 38531.91;
  sData80.low := 31915.41;
  sData80.open := 33368.19;
  sData80.date := 1611878400.0;
  securityDatas[79] := sData80;
  sData81 := SecurityData.Create();
  sData81.volume := 82674.758249;
  sData81.close := 34262.89;
  sData81.high := 34933.01;
  sData81.low := 32825.01;
  sData81.open := 34246.29;
  sData81.date := 1611964800.0;
  securityDatas[80] := sData81;
  sData82 := SecurityData.Create();
  sData82.volume := 66269.928016;
  sData82.close := 33092.99;;
  sData82.high := 34342.7;
  sData82.low := 32171.68;
  sData82.open := 34262.9;
  sData82.date := 1612051200.0;
  securityDatas[81] := sData82;
  sData83 := SecurityData.Create();
  sData83.volume := 80154.567802;
  sData83.close := 33526.38;
  sData83.high := 34717.28;
  sData83.low := 32296.17;
  sData83.open := 33089.45;
  sData83.date := 1612137600.0;
  securityDatas[82] := sData83;
  sData84 := SecurityData.Create();
  sData84.volume := 78056.66988;
  sData84.close := 35466.25;
  sData84.high := 35984.34;
  sData84.low := 33418.01;
  sData84.open := 33517.1;
  sData84.date := 1612224000.0;
  securityDatas[83] := sData84;
  sData85 := SecurityData.Create();
  sData85.volume := 80784.343663;
  sData85.close := 37618.88;
  sData85.high := 37662.64;
  sData85.low := 35362.39;
  sData85.open := 35472.72;
  sData85.date := 1612310400.0;
  securityDatas[84] := sData85;
  sData86 := SecurityData.Create();
  sData86.volume := 89024.320756;
  sData86.close := 36936.67;
  sData86.high := 38708.28;
  sData86.low := 36161.96;
  sData86.open := 37620.27;
  sData86.date := 1612396800.0;
  securityDatas[85] := sData86;
  sData87 := SecurityData.Create();
  sData87.volume := 65910.531514;
  sData87.close := 38290.25;
  sData87.high := 38310.13;
  sData87.low := 36570.01;
  sData87.open := 36936.66;
  sData87.date := 1612483200.0;
  securityDatas[86] := sData87;
  sData88 := SecurityData.Create();
  sData88.volume := 94232.612846;
  sData88.close := 39186.95;
  sData88.high := 40955.52;
  sData88.low := 38215.95;
  sData88.open := 38289.33;
  sData88.date := 1612569600.0;
  securityDatas[87] := sData88;
  sData89 := SecurityData.Create();
  sData89.volume := 81820.439177;
  sData89.close := 38795.7;
  sData89.high := 39700.01;
  sData89.low := 37351.01;
  sData89.open := 39181.02;
  sData89.date := 1612656000.0;
  securityDatas[88] := sData89;
  sData90 := SecurityData.Create();
  sData90.volume := 121568.794672;
  sData90.close := 46374.88;
  sData90.high := 46794.46;
  sData90.low := 37988.9;
  sData90.open := 38795.7;
  sData90.date := 1612742400.0;
  securityDatas[89] := sData90;
  sData91 := SecurityData.Create();
  sData91.volume := 114567.009318;
  sData91.close := 46420.43;
  sData91.high := 48142.2;
  sData91.low := 44961.1;
  sData91.open := 46374.87;
  sData91.date := 1612828800.0;
  securityDatas[90] := sData91;
  sData92 := SecurityData.Create();
  sData92.volume := 78292.89657;
  sData92.close := 44807.59;
  sData92.high := 47310.01;
  sData92.low := 43800.01;
  sData92.open := 46420.43;
  sData92.date := 1612915200.0;
  securityDatas[91] := sData92;
  sData93 := SecurityData.Create();
  sData93.volume := 81033.184776;
  sData93.close := 47969.52;
  sData93.high := 48678.91;
  sData93.low := 43994.03;
  sData93.open := 44807.59;
  sData93.date := 1613001600.0;
  securityDatas[92] := sData93;
  sData94 := SecurityData.Create();
  sData94.volume := 81856.490636;
  sData94.close := 47287.61;
  sData94.high := 48985.81;
  sData94.low := 46400.01;
  sData94.open := 47968.67;
  sData94.date := 1613088000.0;
  securityDatas[93] := sData94;
  sData95 := SecurityData.Create();
  sData95.volume := 58937.84066;
  sData95.close := 47153.7;
  sData95.high := 48150.01;
  sData95.low := 46202.54;
  sData95.open := 47298.16;
  sData95.date := 1613174400.0;
  securityDatas[94] := sData95;
  sData96 := SecurityData.Create();
  sData96.volume := 70700.864117;
  sData96.close := 48577.8;
  sData96.high := 49707.44;
  sData96.low := 47014.18;
  sData96.open := 47156.79;
  sData96.date := 1613260800.0;
  securityDatas[95] := sData96;
  sData97 := SecurityData.Create();
  sData97.volume := 63227.659425;
  sData97.close := 47911.11;
  sData97.high := 49010.93;
  sData97.low := 46174.79;
  sData97.open := 48580.48;
  sData97.date := 1613347200.0;
  securityDatas[96] := sData97;
  sData98 := SecurityData.Create();
  sData98.volume := 78018.176005;
  sData98.close := 49133.46;
  sData98.high := 50080.22;
  sData98.low := 47003.63;
  sData98.open := 47911.11;
  sData98.date := 1613433600.0;
  securityDatas[97] := sData98;
  sData99 := SecurityData.Create();
  sData99.volume := 84886.224046;
  sData99.close := 52119.72;
  sData99.high := 52618.75;
  sData99.low := 48947.01;
  sData99.open := 49133.46;
  sData99.date := 1613520000.0;
  securityDatas[98] := sData99;
  sData100 := SecurityData.Create();
  sData100.volume := 58093.930825;
  sData100.close := 51552.61;
  sData100.high := 52530.01;
  sData100.low := 50901.91;
  sData100.open := 52117.68;
  sData100.date := 1613606400.0;
  securityDatas[99] := sData100;
end;

function CreateTreeNode(var tree:FCTree):FCTreeNode;
var
  treeNode:FCTreeNode;
  paint:FCPaint;
begin
	treeNode := FCTreeNode.Create();
  paint := tree.GetPaint();
	if paint.defaultUIStyle = 'dark' then
    begin
		treeNode.backColor := 'rgb(0,0,0)';
		treeNode.textColor := 'rgb(255,255,255)';
    end
	else if paint.defaultUIStyle = 'light' then
    begin
		treeNode.backColor := 'rgb(200,200,200)';
		treeNode.textColor := 'rgb(0,0,0)';
    end;
	CreateTreeNode := treeNode;
end;

procedure CreateUI();
var
  tabView:FCTabView;
  tabPageTitles:array of string;
  i:integer;
  j:integer;
  tabPage:FCTabPage;
  tButton:FCButton;
  split:FCSplitLayoutDiv;
  firstView:FCView;
  secondView:FCView;
  splitter:FCView;
  indicators:array of string;
  indLayout:FCLayoutDiv;
  indLayout2:FCLayoutDiv;
  button:FCButton;
  plots:array of string;
  grid:FCGrid;
  gridColumn:FCGridColumn;
  gridRow:FCGridRow;
  gridCell:FCGridCell;
  checkBox:FCCheckBox;
  radioButton:FCRadioButton;
  textBox1:FCTextBox;
  chart:FCChart;
  tree:FCTree;
  treeColumn:FCTreeColumn;
  rootNode:FCTreeNode;
  noneNode:FCTreeNode;
  node1:FCTreeNode;
  strs1:array of string;
  subNode1:FCTreeNode;
  node2:FCTreeNode;
  strs2:array of string;
  subNode2:FCTreeNode;
  calendar:FCCalendar;
begin
  appPaint.defaultUIStyle := 'dark';
  touchDownView := FCView.Create();
  touchDownView.isNotEmpty := false;
  touchDownView.uid := -1;
  focusedView := FCView.Create();
  focusedView.isNotEmpty := false;
  focusedView.uid := -1;
  draggingView := FCView.Create();
  draggingView.isNotEmpty := false;
  draggingView.uid := -1;
  touchMoveView := FCView.Create();
  touchMoveView.isNotEmpty := false;
  touchMoveView.uid := -1;
  split := FCSplitLayoutDiv.Create();
  split.size := FCSize.Create(400, 400);
  split.oldSize := FCSize.Create(400, 400);
  split.dock := 'fill';
  split.layoutStyle := 'bottomtotop';
  AddView(FCView(split), appPaint);
  firstView := FCView.Create();
  firstView.backColor := 'rgb(0,0,0)';
  AddViewToParent(firstView, FCView(split));
  secondView := FCView.Create();
  secondView.backColor := 'rgb(0,0,0)';
  AddViewToParent(secondView, FCView(split));
  splitter := FCView.Create();
  splitter.backColor := 'rgb(50,50,50)';
  splitter.location := FCPoint.Create(0, 100);
  splitter.size := FCSize.Create(400, 1);
  AddViewToParent(splitter, FCView(split));
  split.firstView := firstView;
  split.secondView := secondView;
  split.splitter := splitter;

  tabView := FCTabView.Create();
  tabView.backColor := 'rgb(0,0,0)';
  tabView.borderColor := 'rgb(150,150,150)';
  tabView.dock := 'fill';
  AddViewToParent(FCView(tabView), secondView);
  SetLength(tabPageTitles, 4);
  tabPageTitles[0] := '图表';
  tabPageTitles[1] := '指标';
  tabPageTitles[2] := '画线';
  tabPageTitles[3] := '组件';
  for i := 0 to 3 do
  begin
    tabPage := FCTabPage.Create();
    tabPage.backColor := 'rgb(0,0,0)';
    tabPage.borderColor := 'rgb(150,150,150)';
    tButton := FCButton.Create();
    tButton.backColor := 'rgb(0,0,0)';
    tButton.borderColor := 'rgb(150,150,150)';
    tButton.viewType := 'tabbutton';
    tButton.text := tabPageTitles[i];
    tButton.textColor := 'rgb(255,255,255)';
    AddTabPage(tabView, tabPage, FCView(tButton));
  end;

  indLayout := FCLayoutDiv.Create();
  indLayout.backColor := 'rgb(0,0,0)';
  indLayout.dock := 'fill';
  indLayout.autoWrap := true;
  AddViewToParent(FCView(indLayout), FCView(tabView.tabPages[1]));

  SetLength(indicators, 12);
  indicators[0] := 'MA';
  indicators[1] := 'BOLL';
  indicators[2] := 'MACD';
  indicators[3] := 'KDJ';
  indicators[4] := 'BIAS';
  indicators[5] := 'BBI';
  indicators[6] := 'RSI';
  indicators[7] := 'ROC';
  indicators[8] := 'WR';
  indicators[9] := 'DMA';
  indicators[10] := 'TRIX';
  indicators[11] := 'CCI';
  for i := 0 to 11 do
  begin
    button := FCButton.Create();
    button.backColor := 'rgb(50,50,50)';
    button.textColor := 'rgb(255,255,255)';
    button.borderColor := 'rgb(150,150,150)';
    button.text := indicators[i];
    button.viewName := 'Indicator';
    button.size := FCSize.Create(100, 50);
    button.margin := FCPadding.Create(10, 10, 10, 10);
    button.location := FCPoint.Create(0, 0);
    button.hoveredColor := 'rgb(150,150,150)';
    AddViewToParent(FCView(button), FCView(indLayout));
  end;

  indLayout2 := FCLayoutDiv.Create();
  indLayout2.backColor := 'rgb(0,0,0)';
  indLayout2.dock := 'fill';
  indLayout2.autoWrap := true;
  AddViewToParent(FCView(indLayout2), FCView(tabView.tabPages[2]));

  SetLength(plots, 24);
  plots[0] := 'Line';
  plots[1] := 'Segment';
  plots[2] := 'Ray';
  plots[3] := 'Triangle';
  plots[4] := 'Rect';
  plots[5] := 'Cycle';
  plots[6] := 'CircumCycle';
  plots[7] := 'Ellipse';
  plots[8] := 'AngleLine';
  plots[9] := 'LRLine';
  plots[10] := 'LRChannel';
  plots[11] := 'SymmetricTriangle';
  plots[12] := 'LRBand';
  plots[13] := 'ParalleGram';
  plots[14] := 'SpeedResist';
  plots[15] := 'FiboFanline';
  plots[16] := 'FiboTimezone';
  plots[17] := 'Percent';
  plots[18] := 'BoxLine';
  plots[19] := 'TironeLevels';
  plots[20] := 'QuadrantLines';
  plots[21] := 'Parallel';
  plots[22] := 'GoldenRatio';
  plots[23] := 'ArrowSegment';
  for i := 0 to 23 do
  begin
    button := FCButton.Create();
    button.backColor := 'rgb(50,50,50)';
    button.textColor := 'rgb(255,255,255)';
    button.borderColor := 'rgb(150,150,150)';
    button.text := plots[i];
    button.viewName := 'Plot';
    button.size := FCSize.Create(100, 50);
    button.margin := FCPadding.Create(10, 10, 10, 10);
    button.location := FCPoint.Create(0, 0);
    button.hoveredColor := 'rgb(150,150,150)';
    AddViewToParent(FCView(button), FCView(indLayout2));
  end;

  grid := FCGrid.Create();
  grid.dock := 'fill';
  grid.backColor := 'rgb(0,0,0)';
  AddViewToParent(FCView(grid), firstView);
  SetLength(grid.columns, 20);
  for i := 0 to 19 do
  begin
    gridColumn := FCGridColumn.Create();
    gridColumn.text := 'Column';
    gridColumn.backColor := 'rgb(50,50,50)';
    gridColumn.textColor := 'rgb(255,255,255)';
    gridColumn.borderColor := 'rgb(150,150,150)';
    grid.columns[i] := gridColumn;
  end;
  SetLength(grid.rows, 100);
  for i := 0 to 99 do
  begin
    gridRow := FCGridRow.Create();
    grid.rows[i] := gridRow;
    SetLength(gridRow.cells, 20);
    for j := 0 to 19 do
    begin
      gridCell := FCGridCell.Create();
      gridCell.value := 'Cell';
      gridCell.textColor := 'rgb(255,255,255)';
      gridCell.backColor := 'rgb(0,0,0)';
      gridCell.borderColor := 'rgb(150,150,150)';
      gridCell.column := grid.columns[j];
      gridRow.cells[j] := gridCell;
    end;
  end;

  for i := 0 to 3 do
  begin
    checkBox := FCCheckBox.Create();
    checkBox.text := 'CheckBox';
    checkBox.size := FCSize.Create(100, 20);
    checkBox.location := FCPoint.Create(i * 100 + 50, 50);
    checkBox.textColor := 'rgb(255,255,255)';
    AddViewToParent(FCView(checkBox), FCView(tabView.tabPages[3]));
  end;
  for i := 0 to 3 do
  begin
    radioButton := FCRadioButton.Create();
    radioButton.text := 'Radio';
    radioButton.size := FCSize.Create(100, 20); 
    radioButton.location := FCPoint.Create(i * 100 + 50, 100);
    radioButton.textColor := 'rgb(255,255,255)';
    AddViewToParent(FCView(radioButton), FCView(tabView.tabPages[3]));
  end;
  textBox1 := FCTextBox.Create();
  textBox1.size := FCSize.Create(100, 20);
  textBox1.location := FCPoint.Create(50, 150);
  textBox1.textColor := 'rgb(255,255,255)';
  textBox1.viewName := 'textBox';
  textBox1.exView := true;
  CreateView(appPaint.gID, PChar('textbox'), PChar('textBox'));
  SetAttribute2(appPaint.gID, PChar('textBox'), PChar('backcolor'), PChar('rgb(0,0,0)'));
  SetAttribute2(appPaint.gID, PChar('textBox'), PChar('bordercolor'), PChar('rgb(100,100,100)'));
  SetAttribute2(appPaint.gID, PChar('textBox'), PChar('textcolor'), PChar('rgb(255,255,255)'));
  AddViewToParent(FCView(textBox1), FCView(tabView.tabPages[3]));

  tree := FCTree.Create();
  tree.location := FCPoint.Create(50,200);
  tree.size := FCSize.Create(300,300);
  tree.backColor := 'rgb(0,0,0)';
  AddViewToParent(FCView(tree), FCView(tabView.tabPages[3]));
  tree.headerHeight := 0;
  tree.showCheckBox := true;
  treeColumn := FCTreeColumn.Create();
  treeColumn.width := 500;
  SetLength(tree.columns, 1);
  tree.columns[0] := treeColumn;

  calendar := FCCalendar.Create();
  calendar.location := FCPoint.Create(400,50);
  calendar.size := FCSize.Create(500,400);
  AddViewToParent(FCView(calendar), FCView(tabView.tabPages[3]));
  InitCalendar(calendar);
  calendar.selectedDay := GetYear(calendar, 2023).months[10].days[1];
  noneNode := FCTreeNode.Create();
  rootNode := CreateTreeNode(tree);
  rootNode.value := '证监会行业类';
  AppendTreeNode(tree, rootNode, noneNode);

  node1 := CreateTreeNode(tree);
  node1.value := '农、林、牧、渔业';
  AppendTreeNode(tree, node1, rootNode);
  
  SetLength(strs1, 5);
  strs1[0] := '农业';
  strs1[1] := '林业';
  strs1[2] := '畜牧业';
  strs1[3] := '渔业';
  strs1[4] := '农、林、牧、渔服务业';
  for i := 0 to 4 do
  begin
    subNode1 := CreateTreeNode(tree);
    subNode1.value := strs1[i];
    AppendTreeNode(tree, subNode1, node1);
  end;

  node2 := CreateTreeNode(tree);
  node2.value := '采矿业';
  AppendTreeNode(tree, node2, rootNode);

  SetLength(strs2, 6);
  strs2[0] := '煤炭开采和洗选业';
  strs2[1] := '石油和天然气开采业';
  strs2[2] := '黑色金属矿采选业';
  strs2[3] := '有色金属矿采选业';
  strs2[4] := '非金属矿采选业';
  strs2[5] := '开采辅助活动';
  for i := 0 to 5 do
  begin
    subNode2 := CreateTreeNode(tree);
    subNode2.value := strs2[i];
    AppendTreeNode(tree, subNode2, node2);
  end;

  chart := FCChart.Create();
  tChart := chart;
  chart.dock := 'fill';
  chart.backColor := 'rgb(0,0,0)';
  chart.showIndicator := 'MACD';
  chart.mainIndicator := 'BOLL';
  chart.textColor := 'rgb(255,255,255)';
  chart.gridColor := 'rgb(100,100,100)';
  chart.scaleColor := 'rgb(100,100,100)';
  AddViewToParent(FCView(chart), FCView(tabView.tabPages[0]));
  SetLength(chart.data, 100);
  SetLength(chart.indicatorColors, 8);
  chart.indicatorColors[0] := 'rgb(255,255,255)';
  chart.indicatorColors[1] := 'rgb(255,255,0)';
  chart.indicatorColors[2] := 'rgb(255,0,255)';
  chart.indicatorColors[3] := 'rgb(255,0,0)';
  chart.indicatorColors[4] := 'rgb(0,255,255)';
  chart.indicatorColors[5] := 'rgb(0,255,0)';
  chart.indicatorColors[6] := 'rgb(255,255,0)';
  chart.indicatorColors[7] := 'rgb(255,255,255)';
  GetSecurities(chart.data);
  ResetChartVisibleRecord(chart);
  CheckChartLastVisibleIndex(chart);
  CalcChartIndicator(chart);
  SelectTabPage(tabView, tabView.tabPages[0]);
end;

begin
  appPaint := FCPaint.Create();
  OnPaintEvent := @OnPaint;
  OnPaintBorderEvent := @OnPaintBorder;
  OnMouseDownEvent := @OnMouseDown;
  OnMouseMoveEvent := @OnMouseMove;
  OnMouseUpEvent := @OnMouseUp;
  OnMouseWheelEvent := @OnMouseWheel;
  UpdateViewEvent := @UpdateView;
  OnClickEvent := @OnClick;
  OnKeyDownEvent := @OnKeyDown;
  OnKeyUpEvent := @OnKeyUp;
  ShowWindow2();
  ShowWindowMax();
  appPaint.hWnd := GetHWnd();
  appPaint.gID := CreateGdiPlus(appPaint.hWnd); 
  appPaint.size := FCSize.Create(getWindowWidth(appPaint.hWnd), getWindowHeight(appPaint.hWnd));
  RegisterWndProc(@WndProc);
  CreateUI();
  while GetMessage() = 1 do
  begin
		DoMessage();
	end;
end.

